package com.groupbuying.store.dao;

import com.groupbuying.store.dto.forManage.StoreManageExportPageDTO;
import com.groupbuying.store.dto.forManage.StoreOperDTO;
import com.groupbuying.store.dto.forManage.StoreShopAuditPageDTO;
import com.groupbuying.store.dto.forManage.StoreShopManagePageDTO;
import com.groupbuying.store.utils.Query;
import com.groupbuying.store.domain.StoreMainInfoDO;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * 商户主信息
 * @author wenguoqiang
 * @email 17081@mengtaigroup.com
 * @date 2019-01-24 10:31:25
 */
@Mapper
@Repository
public interface StoreMainInfoDao {

	StoreMainInfoDO get(String uuid);
	
	List<StoreMainInfoDO> list(Map<String, Object> map);
	
	int count(Map<String, Object> map);
	
	int save(StoreMainInfoDO storeMainInfo);
	
	int update(StoreMainInfoDO storeMainInfo);
	
	int remove(String uuid);
	
	int batchRemove(String[] uuids);

	/**
	 * 根据uuids
	 * @param uuids
	 * @return
	 */
	List<StoreMainInfoDO> getByUuids(List<String> uuids);

	/**
	 * 批量修改
	 * @param stores
	 */
    void batchUpdate(List<StoreMainInfoDO> stores);

	/**
	 * 根据
	 * @param map
	 * @return
	 */
    List<StoreMainInfoDO> getStoreListByProviderIdAndAccountId(Map map);

	/**
	 * 数量统计
	 * @param query
	 * @return
	 */
	int getStoreListByProviderIdAndAccountIdCount(Query query);

	/**
	 * 查询列表页
	 * @param query
	 * @return
	 */
    List<StoreShopAuditPageDTO> getListByPage(Query query);

	/**
	 * 门店查询管理列表页
	 * @param query
	 * @return
	 */
	List<StoreShopManagePageDTO> getListByManagePage(Query query);


    List<Map<String, String>> getUuidAndStoreName();

	/**
	 * 门店查询运营人员
	 * @param query
	 * @return
	 */
	List<StoreOperDTO> getStoreOperList(Query query);

	/**
	 * 通过收银台id获取商户信息
	 * */
	Map getStoreInfoByCounterUuid(String counterid);

	/**
	 * 门店编辑费率
	 */
	int setRate(Map<String ,Object> condMap);
	/**
	 * 根据chaiStoreUuid修改
	 */
	int updateByChainStoresUuid(Map<String,Object> map);

	/**
	 * 获取导出列表
	 * @param query
	 * @return
	 */
	List<StoreManageExportPageDTO> getExportStoreMangeList(Query query);

	/**
	 * 获取财务查看的商户审核列表
	 * @param query
	 * @return
	 */
    List<StoreShopAuditPageDTO> getListByPageInFinance(Query query);

	/**
	 * 服务商后台:门店管理列表查询
	 * @param map
	 * @return
	 */
	List<StoreMainInfoDO> getShopList(Map<String, Object> map);

	/**
	 * 服务商后台:门店管理列表总条数
	 * @param map
	 * @return
	 */
	int getShopCount(Map<String, Object> map);
}
